package com.controller;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import sun.org.mozilla.javascript.internal.regexp.SubString;
import com.util.ConfigUtil;

import com.util.BODY;
import com.util.HttpRequest;
import com.util.JSONUtil;
import com.util.OpenKey;
import com.util.ReadConfig;
import com.util.SessionInfo;

/**
 * 单位编辑汇缴清册
 * @author 
 */
@Controller
@RequestMapping("/dwbjhjqccontroller")
public class dwbjhjqccontroller {

	private static final Logger logger = Logger.getLogger(dwbjhjqccontroller.class);
	Map map  = new HashMap();
	List list = new ArrayList();
	  
	@RequestMapping("/test1")
	@ResponseBody
	//汇缴清册编辑
	public String entryinterface(HttpServletRequest request,HttpSession session, HttpServletResponse response , String limit ,String id,String start,String end,String XINGMING,String ZJHM) throws IOException{
		SessionInfo sessionIn = (SessionInfo) session.getAttribute(ConfigUtil.getSessionInfoName());
		//读取配置文件路劲
		String interfaceUrl = ReadConfig.readValue();
		String JCQK="缴存";
		Map reqMap = new HashMap();
		BODY b=new BODY();
		OpenKey p=new OpenKey();
		//接口编码
		reqMap.put("AUTHORITY", "YBGJJ126");
		//接口参数
		reqMap.put("LOGUserName", "admin");
		reqMap.put("OpenKey",sessionIn.getKEY());
		b.setDWZH(sessionIn.getDWZH());
		b.setRQJCQK("全部");
		reqMap.put("BODY",b);
		String  result = p.getOpenKey(reqMap, session);
		Map retMap = JSONUtil.toMap(result);
		if(retMap.get("RETURNCODE").equals("100")){
		retMap = (Map) retMap.get("body");
    	List retlist = (List)retMap.get("RETDATA");
		for (int i = 0; i < retlist.size(); i++) {		
			Map map = (Map) retlist.get(i);
			map.put("DWMC", retMap.get("DWMC").toString());	
		}
		logger.info("接口返回内容:"+result);
		if(result != null){
			Map resMap = JSONUtil.toMap(result);
			List listttmp = new ArrayList();
			for(int i=0;i<=retlist.size()-1;i++){
			  Map map=(Map)retlist.get(i);
				if(XINGMING!=null && !XINGMING.equals("")){
					if(map.get("XINGMING")==null || map.get("XINGMING").equals("")){
						continue;
					}else if(!XINGMING.equals(map.get("XINGMING").toString())){
						continue;
					}
				}
				
				if(JCQK!=null && !JCQK.equals("")){
					if(map.get("JCQK")==null || map.get("JCQK").equals("")){
						continue;
					}else if(!JCQK.equals(map.get("JCQK").toString())){
						continue;
					}
				}
				if(ZJHM!=null && !ZJHM.equals("")){
					if(map.get("ZJHM")==null || map.get("ZJHM").equals("")){
						continue;
					}else if(!ZJHM.equals(map.get("ZJHM").toString())){
						continue;
					}	
				}
				//
				listttmp.add(map);
			}
			map.put("code", 0); 
			map.put("msg", resMap.get("RETURNDESC"));
			map.put("data",listttmp);
			response.setHeader("Content-type", "text/html;charset=UTF-8");
			response.setCharacterEncoding("UTF-8");
			String jsonString = JSONUtil.ToJsongString2(map);
			PrintWriter pw = response.getWriter();
			pw.write(jsonString);
		}
		
	}
		return null;
	}
	@RequestMapping("/test2")
	@ResponseBody
	public String rytj(HttpServletRequest request,HttpSession session, HttpServletResponse response , String limit ,String id,String start,String end) throws IOException{
		SessionInfo sessionIn = (SessionInfo) session.getAttribute(ConfigUtil.getSessionInfoName());
		//读取配置文件路劲
		String interfaceUrl = ReadConfig.readValue();
		
		Map reqMap = new HashMap();
		BODY b=new BODY();
		OpenKey p=new OpenKey();
		//接口编码
		reqMap.put("AUTHORITY", "YBGJJ126");
		//接口参数
		reqMap.put("OpenKey",sessionIn.getKEY());
		reqMap.put("LOGUserName","admin");
		b.setDWZH(sessionIn.getDWZH());
		b.setRQJCQK("缴存");
		reqMap.put("BODY",b);
		String  result = p.getOpenKey(reqMap, session);
		Map retMap = JSONUtil.toMap(result);
		if(retMap.get("RETURNCODE").equals("100")){
		retMap = (Map) retMap.get("body");
    	List retlist = (List)retMap.get("RETDATA");
		for (int i = 0; i < retlist.size(); i++) {	
			Map map = (Map) retlist.get(i);
			map.put("DWZH", retMap.get("DWZH").toString());			
		}
		logger.info("接口返回内容:"+result);
		if(result != null){
			Map resMap = JSONUtil.toMap(result);
				//List resList = JSONUtil.toList(resMap.get("body").toString());
				//map.put("count", resList.size());
				map.put("code", 0); 
				map.put("msg", resMap.get("RETURNDESC"));
				map.put("data", retlist);
				
				response.setHeader("Content-type", "text/html;charset=UTF-8");
				response.setCharacterEncoding("UTF-8");
				String jsonString = JSONUtil.ToJsongString2(map);
				PrintWriter pw = response.getWriter();
				pw.write(jsonString);
		}
		}
		return null;
	}
	@RequestMapping("/test3")
	@ResponseBody
	public String hfjc(HttpServletRequest request,HttpSession session, HttpServletResponse response , String limit ,String id,String start,String end) throws IOException{
		SessionInfo sessionIn = (SessionInfo) session.getAttribute(ConfigUtil.getSessionInfoName());
		//读取配置文件路劲
		String interfaceUrl = ReadConfig.readValue();
		
		Map reqMap = new HashMap();
		BODY b=new BODY();
		OpenKey p=new OpenKey();
		//接口编码
		reqMap.put("AUTHORITY", "YBGJJ126");
		//接口参数
		reqMap.put("OpenKey",sessionIn.getKEY());
		reqMap.put("LOGUserName","admin");
		b.setDWZH(sessionIn.getDWZH());
		b.setRQJCQK("停缴");
		reqMap.put("BODY",b);
		String  result = p.getOpenKey(reqMap, session);
		Map retMap = JSONUtil.toMap(result);
		if(retMap.get("RETURNCODE").equals("100")){
		retMap = (Map) retMap.get("body");
    	List retlist = (List)retMap.get("RETDATA");
		for (int i = 0; i < retlist.size(); i++) {
			
			Map map = (Map) retlist.get(i);
			map.put("DWZH", retMap.get("DWZH").toString());
			   
			
		}
		}

		
		logger.info("接口返回内容:"+result);
		if(result != null){
			Map resMap = JSONUtil.toMap(result);
			Map retMap1 = (Map) resMap.get("body");
				//List resList = JSONUtil.toList(resMap.get("body").toString());
				//map.put("count", resList.size());
				map.put("code", 0); 
				map.put("msg", resMap.get("RETURNDESC"));
				map.put("data", retMap1.get("RETDATA"));
				
				response.setHeader("Content-type", "text/html;charset=UTF-8");
				response.setCharacterEncoding("UTF-8");
				String jsonString = JSONUtil.ToJsongString2(map);
				PrintWriter pw = response.getWriter();
				pw.write(jsonString);
		}
		return null;
	}
	@RequestMapping("/bj")
	@ResponseBody
	public String bj(HttpServletRequest request,HttpSession session, HttpServletResponse response , String limit ,String GRZH,String JCQK,String XINGMING,String ZJHM) throws IOException{
		SessionInfo sessionIn = (SessionInfo) session.getAttribute(ConfigUtil.getSessionInfoName());
		//读取配置文件路劲
		String interfaceUrl = ReadConfig.readValue();
		XINGMING =new String(XINGMING.getBytes("iso8859-1"),"utf-8");
		JCQK =new String(JCQK.getBytes("iso8859-1"),"utf-8");
		Map reqMap = new HashMap();
		//接口编码
		BODY b=new BODY();
		OpenKey p=new OpenKey();
		//接口编码
		reqMap.put("AUTHORITY", "YBGJJ126");
		//接口参数
		reqMap.put("OpenKey",sessionIn.getKEY());
		reqMap.put("LOGUserName","admin");
		b.setDWZH(sessionIn.getDWZH());
		b.setRQJCQK(JCQK);
		reqMap.put("BODY",b);
		String  result = p.getOpenKey(reqMap, session);
		Map retMap = JSONUtil.toMap(result);
		if(retMap.get("RETURNCODE").equals("100")){
		retMap = (Map) retMap.get("body");
    	List retlist = (List)retMap.get("RETDATA");

		logger.info("接口返回内容:"+result);
		if(result != null){
			Map resMap = JSONUtil.toMap(result);
					List listttmp = new ArrayList();
					for(int i=0;i<=retlist.size()-1;i++){
					  Map map=(Map)retlist.get(i);
						if(XINGMING!=null && !XINGMING.equals("")){
							if(map.get("XINGMING")==null || map.get("XINGMING").equals("")){
								continue;
							}else if(!XINGMING.equals(map.get("XINGMING").toString())){
								continue;
							}
						}
						
						if(JCQK!=null && !JCQK.equals("")){
							if(map.get("JCQK")==null || map.get("JCQK").equals("")){
								continue;
							}else if(!JCQK.equals(map.get("JCQK").toString())){
								continue;
							}
						}
						if(ZJHM!=null && !ZJHM.equals("")){
							if(map.get("ZJHM")==null || map.get("ZJHM").equals("")){
								continue;
							}else if(!ZJHM.equals(map.get("ZJHM").toString())){
								continue;
							}	
						}
						if(GRZH!=null && !GRZH.equals("")){
							if(map.get("GRZH")==null || map.get("GRZH").equals("")){
								continue;
							}else if(!GRZH.equals(map.get("GRZH").toString())){
								continue;
							}	
						}
						//
						listttmp.add(map);
					}
					map.put("code", 0); 
					map.put("msg", null);
					map.put("data",listttmp);
					response.setHeader("Content-type", "text/html;charset=UTF-8");
					response.setCharacterEncoding("UTF-8");
					String jsonString = JSONUtil.ToJsongString2(map);
					PrintWriter pw = response.getWriter();
					pw.write(jsonString);
		}
		}
		return null;
	}
	@RequestMapping("/hfjcbj")
	@ResponseBody
	public String hfjcbj(HttpServletRequest request,HttpSession session, HttpServletResponse response , String limit ,String GRZH,String JCQK,String XINGMING,String ZJHM) throws IOException{
		SessionInfo sessionIn = (SessionInfo) session.getAttribute(ConfigUtil.getSessionInfoName());
		//读取配置文件路劲
		String interfaceUrl = ReadConfig.readValue();
		Map reqMap = new HashMap();
		BODY b=new BODY();
		OpenKey p=new OpenKey();
		//接口编码
		reqMap.put("AUTHORITY", "YBGJJ126");
		//接口参数
		reqMap.put("OpenKey",sessionIn.getKEY());
		reqMap.put("LOGUserName","admin");
		b.setDWZH(sessionIn.getDWZH());
		b.setRQJCQK("停缴");
		reqMap.put("BODY",b);
		String  result = p.getOpenKey(reqMap, session);
		Map retMap = JSONUtil.toMap(result);
		if(retMap.get("RETURNCODE").equals("100")){
		retMap = (Map) retMap.get("body");
    	List retlist = (List)retMap.get("RETDATA");
		for (int i = 0; i < retlist.size(); i++) {
			
			Map map = (Map) retlist.get(i);
			map.put("DWZH", retMap.get("DWZH").toString());
			   
			
		}
		logger.info("接口返回内容:"+result);
		if(result != null){
			Map resMap = JSONUtil.toMap(result);
					List listttmp = new ArrayList();
					for(int i=0;i<=retlist.size()-1;i++){
					  Map map=(Map)retlist.get(i);
						if(GRZH!=null && !GRZH.equals("")){
							if(map.get("GRZH")==null || map.get("GRZH").equals("")){
								continue;
							}else if(!GRZH.equals(map.get("GRZH").toString())){
								continue;
							}
						}
						//
						listttmp.add(map);
					}
					map.put("code", 0); 
					map.put("msg", null);
					map.put("data",listttmp);
					response.setHeader("Content-type", "text/html;charset=UTF-8");
					response.setCharacterEncoding("UTF-8");
					String jsonString = JSONUtil.ToJsongString2(map);
					PrintWriter pw = response.getWriter();
					pw.write(jsonString);
		}
		}
		return null;
	}
	@RequestMapping("/tzjcbj")
	@ResponseBody
	public String tzjcbj(HttpServletRequest request,HttpSession session, HttpServletResponse response , String limit ,String GRZH,String JCQK,String XINGMING,String ZJHM) throws IOException{
		SessionInfo sessionIn = (SessionInfo) session.getAttribute(ConfigUtil.getSessionInfoName());
		//读取配置文件路劲
		String interfaceUrl = ReadConfig.readValue();
		Map reqMap = new HashMap();
		BODY b=new BODY();
		OpenKey p=new OpenKey();
		//接口编码
		reqMap.put("AUTHORITY", "YBGJJ126");
		//接口参数
		reqMap.put("OpenKey",sessionIn.getKEY());
		reqMap.put("LOGUserName","admin");
		b.setDWZH(sessionIn.getDWZH());
		b.setRQJCQK("缴存");
		reqMap.put("BODY",b);
		String  result = p.getOpenKey(reqMap, session);
		Map retMap = JSONUtil.toMap(result);
		if(retMap.get("RETURNCODE").equals("100")){
		retMap = (Map) retMap.get("body");
    	List retlist = (List)retMap.get("RETDATA");
		for (int i = 0; i < retlist.size(); i++) {
			
			Map map = (Map) retlist.get(i);
			map.put("DWZH", retMap.get("DWZH").toString());
			   
			
		}
		logger.info("接口返回内容:"+result);
		if(result != null){
			Map resMap = JSONUtil.toMap(result);
					List listttmp = new ArrayList();
					for(int i=0;i<=retlist.size()-1;i++){
					  Map map=(Map)retlist.get(i);
						if(GRZH!=null && !GRZH.equals("")){
							if(map.get("GRZH")==null || map.get("GRZH").equals("")){
								continue;
							}else if(!GRZH.equals(map.get("GRZH").toString())){
								continue;
							}
						}
						//
						listttmp.add(map);
					}
					map.put("code", 0); 
					map.put("msg", null);
					map.put("data",listttmp);
					response.setHeader("Content-type", "text/html;charset=UTF-8");
					response.setCharacterEncoding("UTF-8");
					String jsonString = JSONUtil.ToJsongString2(map);
					PrintWriter pw = response.getWriter();
					pw.write(jsonString);
		}
		}
		return null;
	}
	@RequestMapping("/qrbj")
	@ResponseBody
	public String qrbj(HttpServletRequest request,HttpSession session, HttpServletResponse response ,String DWJCBL,String SJHM,String GRJCJS,String GRJCBL, String limit ,String GRZH,String JCQK,String XINGMING,String ZJHM) throws IOException{
		SessionInfo sessionIn = (SessionInfo) session.getAttribute(ConfigUtil.getSessionInfoName());
		//读取配置文件路劲
		String interfaceUrl = ReadConfig.readValue();
		Map reqMap = new HashMap();
		OpenKey p=new OpenKey();
		//接口编码
		XINGMING =new String(XINGMING.getBytes("iso8859-1"),"utf-8");
		reqMap.put("AUTHORITY", "YBGJJ157");
		BODY b=new BODY();
		//接口参数
		reqMap.put("LOGUserName","admin");
		reqMap.put("OpenKey",sessionIn.getKEY());
		b.setXINGMING(XINGMING);
		b.setDWJCBL(DWJCBL);
		b.setGRJCBL(GRJCBL);
		b.setGRZH(GRZH);
		b.setZJHM(ZJHM);
		b.setSJHM(SJHM);
		b.setGRJCJS(GRJCJS);
		reqMap.put("BODY",b);
		String  result = p.getOpenKey(reqMap, session);
		Map retMap = JSONUtil.toMap(result);
		if(result!=null){
		retMap = (Map) retMap.get("body");
		logger.info("接口返回内容:"+result);
			Map resMap = JSONUtil.toMap(result);
			if(result!=null){
				//List resList = JSONUtil.toList(resMap.get("body").toString());
				//map.put("count", resList.size());
				map.put("code", 0); 
				map.put("msg", resMap.get("RETURNDESC"));
				map.put("data", retMap);
				
				response.setHeader("Content-type", "text/html;charset=UTF-8");
				response.setCharacterEncoding("UTF-8");
				String jsonString = JSONUtil.ToJsongString2(map);
				PrintWriter pw = response.getWriter();
				pw.write(jsonString);
		}
		}
		return null;
	}
	@RequestMapping("/tj")
	@ResponseBody
	public String tj(HttpServletRequest request,HttpSession session, HttpServletResponse response ,String DWJCBL,String SJHM,String GRJCJS,String GRJCBL, String limit ,String t,String z,String x,String g) throws IOException{
		SessionInfo sessionIn = (SessionInfo) session.getAttribute(ConfigUtil.getSessionInfoName());
		
		//读取配置文件路劲
		String interfaceUrl = ReadConfig.readValue();
		Map reqMap = new HashMap();
		OpenKey p=new OpenKey();
		//接口编码
		reqMap.put("AUTHORITY", "YBGJJ160");
		x =new String(x.getBytes("iso8859-1"),"utf-8");

		String tj=t.substring(0,7);
		String tjsj=tj.replace("-", "");
		BODY b=new BODY();
		//接口参数
		reqMap.put("LOGUserName","admin");
		reqMap.put("OpenKey",sessionIn.getKEY());
		b.setXINGMING(x);
		b.setGRZH(g);
		b.setZJHM(z);
		b.setNY(tjsj);
		reqMap.put("BODY",b);
		String  result = p.getOpenKey(reqMap, session);
		Map retMap = JSONUtil.toMap(result);
		if(result!=null){
		retMap = (Map) retMap.get("body");
		logger.info("接口返回内容:"+result);
		if(result != null){
			Map resMap = JSONUtil.toMap(result);
				//List resList = JSONUtil.toList(resMap.get("body").toString());
				//map.put("count", resList.size());
				map.put("code", 0); 
				map.put("msg", resMap.get("RETURNDESC"));
				map.put("data", retMap);
				
				response.setHeader("Content-type", "text/html;charset=UTF-8");
				response.setCharacterEncoding("UTF-8");
				String jsonString = JSONUtil.ToJsongString2(map);
				PrintWriter pw = response.getWriter();
				pw.write(jsonString);
		}
		}
		return null;
	}
	@RequestMapping("/hf")
	@ResponseBody
	public String hf(HttpServletRequest request,HttpSession session, HttpServletResponse response ,String DWJCBL,String SJHM,String GRJCJS,String GRJCBL, String limit ,String t,String z,String x,String g) throws IOException{
		SessionInfo sessionIn = (SessionInfo) session.getAttribute(ConfigUtil.getSessionInfoName());
		
		//读取配置文件路劲
		String interfaceUrl = ReadConfig.readValue();
		Map reqMap = new HashMap();
		//接口编码
		reqMap.put("AUTHORITY", "YBGJJ161");
		x =new String(x.getBytes("iso8859-1"),"utf-8");
		String tj=t.substring(0,7);
		String tjsj=tj.replace("-", "");
		
		BODY b=new BODY();
		OpenKey p=new OpenKey();
		//接口参数
		reqMap.put("LOGUserName","admin");
		reqMap.put("OpenKey",sessionIn.getKEY());
		b.setXINGMING(x);
		b.setGRZH(g);
		b.setZJHM(z);
		b.setNY(tjsj);
		reqMap.put("BODY",b);
		String  result = p.getOpenKey(reqMap, session);
		Map retMap = JSONUtil.toMap(result);
		retMap = (Map) retMap.get("body");
		logger.info("接口返回内容:"+result);
		if(result != null){
			Map resMap = JSONUtil.toMap(result);
			if(result!=null){
				//List resList = JSONUtil.toList(resMap.get("body").toString());
				//map.put("count", resList.size());
				map.put("code", 0); 
				map.put("msg", resMap.get("RETURNDESC"));
				map.put("data", retMap);
				
				response.setHeader("Content-type", "text/html;charset=UTF-8");
				response.setCharacterEncoding("UTF-8");
				String jsonString = JSONUtil.ToJsongString2(map);
				PrintWriter pw = response.getWriter();
				pw.write(jsonString);
			}
		}
		return null;
	}
	@RequestMapping("/hjxz")
	@ResponseBody																				
	public String xz(HttpServletRequest request,HttpSession session, HttpServletResponse response ,String xingming,String zjhm,String dwjce,String grjce, String jcksny ,String sjhm,String dwyx,String jtysr,String gddhhm,String zjlx,String hyzk,String zy,String zc,String zw,String xl,String jtzz) throws IOException{
		SessionInfo sessionIn = (SessionInfo) session.getAttribute(ConfigUtil.getSessionInfoName());
		
		//读取配置文件路劲
		String interfaceUrl = ReadConfig.readValue();
		
		Map reqMap = new HashMap();
		BODY b=new BODY();
		OpenKey p=new OpenKey();
		//接口编码
		reqMap.put("AUTHORITY", "YBGJJ159");
		reqMap.put("LOGUserName", "admin");
		reqMap.put("OpenKey",sessionIn.getKEY());
		//接口参数
		//reqMap.put("XINGMING",xingming);
		b.setXINGMING(xingming);
		//reqMap.put("DWZH",sessionIn.getDWZH());
		b.setDWZH(sessionIn.getDWZH());
		//reqMap.put("ZJHM",zjhm);
		b.setZJHM(zjhm);
		//reqMap.put("DWJCE",dwjce);
		b.setDWJCE(dwjce);
		//reqMap.put("GRJCE",grjce);
		b.setGRJCE(grjce);
		//reqMap.put("CJNY",jcksny);
		b.setCJNY(jcksny);
		//reqMap.put("SJHM",sjhm);
		b.setSJHM(sjhm);
		//reqMap.put("DWYB",dwyx);
		b.setDWYB(dwyx);
		//reqMap.put("JTYSR",jtysr);
		b.setJTYSR(jtysr);
		//reqMap.put("JBRGDDHHM",gddhhm);
		b.setJBRGDDHHM(gddhhm);
		//reqMap.put("ZJLX",zjlx);
		b.setZJLX(zjlx);
		//reqMap.put("HYZK",hyzk);
		b.setHYZK(hyzk);
		//reqMap.put("ZY",zy);
		b.setZY(zy);
		//reqMap.put("ZC",zc);
		b.setZC(zc);
		//reqMap.put("ZW",zw);
		b.setZW(zw);
		//reqMap.put("XL",xl);
		b.setXL(xl);
		//reqMap.put("JTZZ",jtzz);
		b.setJTZZ(jtzz);
		reqMap.put("BODY",b);
		String  result = p.getOpenKey(reqMap, session);
		Map retMap = JSONUtil.toMap(result);
		if(result!=null){
		retMap = (Map) retMap.get("body");
		logger.info("接口返回内容:"+result);
		if(result != null){
			Map resMap = JSONUtil.toMap(result);
				//List resList = JSONUtil.toList(resMap.get("body").toString());
				//map.put("count", resList.size());
				map.put("code", 0); 
				map.put("msg", resMap.get("RETURNDESC"));
				map.put("data", retMap);
				
				response.setHeader("Content-type", "text/html;charset=UTF-8");
				response.setCharacterEncoding("UTF-8");
				String jsonString = JSONUtil.ToJsongString2(map);
				PrintWriter pw = response.getWriter();
				pw.write(jsonString);
		}
		}
		return null;
	}
	@RequestMapping("/xlhx")
	@ResponseBody
	public String cxxlk(HttpServletRequest request,HttpSession session, HttpServletResponse response , String limit ,String id,String start,String end) throws IOException{
		SessionInfo sessionIn = (SessionInfo) session.getAttribute(ConfigUtil.getSessionInfoName());
		//读取配置文件路劲
		String interfaceUrl = ReadConfig.readValue();
		OpenKey p=new OpenKey();
		Map reqMap = new HashMap();
		//接口编码
		reqMap.put("AUTHORITY", "YBGJJ158");
		//接口参数
		
		reqMap.put("LOGUserName","admin");
		reqMap.put("OpenKey",sessionIn.getKEY());
		String  result = p.getOpenKey(reqMap, session);
		Map retMap = JSONUtil.toMap(result);
		if(retMap.get("RETURNCODE").equals("100")){
		retMap = (Map) retMap.get("body");
		List list = (List)retMap.get("RETDATA");
		List listttmp = new ArrayList();//容器
		for(int i=0;i<list.size();i++){
			  List a=(List) list.get(i);
			  listttmp.add(a);
		}
		List hy=(List) listttmp.get(0);
		List zy=(List) listttmp.get(1);
		List zc=(List) listttmp.get(2);
		List zw=(List) listttmp.get(3);
		List xl=(List) listttmp.get(4);
    	List retlist = (List)retMap.get("RETDATA");
		logger.info("接口返回内容:"+result);
		if(result != null){
			Map resMap = JSONUtil.toMap(result);
				//List resList = JSONUtil.toList(resMap.get("body").toString());
				//map.put("count", resList.size());
				map.put("code", 0); 
				map.put("msg", resMap.get("RETURNDESC"));
				map.put("data", listttmp.get(0));
				map.put("data1", listttmp.get(1));
				map.put("data2", listttmp.get(2));
				map.put("data3", listttmp.get(3));
				map.put("data4", listttmp.get(4));
				response.setHeader("Content-type", "text/html;charset=UTF-8");
				response.setCharacterEncoding("UTF-8");
				String jsonString = JSONUtil.ToJsongString2(map);
				PrintWriter pw = response.getWriter();
				pw.write(jsonString);
		}
		}
		return null;
	}
}
